<?php
namespace app\admin\validate;

use think\Validate;

class PolicyAgreement extends Validate
{

    protected $rule = [
        'id' => 'require',
        'title' => 'require|unique:policy_agreement,title^delete_time',
    ];

    protected $message = [
        'id.require' => 'id不可为空',
        'title.require' => '请输入标题',
        'title.unique' => '标题不能重复！',
    ];

    protected function sceneAdd()
    {
        $this->remove('id');

    }

    protected function sceneEdit()
    {

    }

    public function sceneDel()
    {
        $this->only(['id']);
    }
}